﻿-- =============================================
-- Deletion Trigger Template
-- =============================================
--CREATE TRIGGER [dbo].[Table_DeletionTrigger] 
--    ON [Table] 
--    AFTER DELETE 
--AS 
--SET NOCOUNT ON 
--UPDATE [dbo].[Table_Tombstone] 
--    SET [DeletionDate] = GETUTCDATE() 
--    FROM deleted 
--    WHERE deleted.[TableGuid] = [Table_Tombstone].[TableGuid] 
--IF @@ROWCOUNT = 0 
--BEGIN 
--    INSERT INTO [dbo].[Table_Tombstone] 
--    ([TableGuid], DeletionDate)
--    SELECT [TableGuid], GETUTCDATE()
--    FROM deleted 
--END